import axios from "axios"
// 设置基础的url
axios.defaults.baseURL = '/api'

/**
 * 查询文章列表
 * @param {{}} data 
 * @returns 
 */
export const list = (data) =>{
  return axios.post("/cms/article/list",data)
}
/**
 * 查询文章信息
 * @param {{}} id 
 * @returns 
 */
 export const get = (id) =>{
  return axios.post("/cms/article/get",{
    id: id
  })
}
/**
 * 添加文章
 * @param {{}} data 
 * @returns 
 */
 export const save = (data) =>{
  return axios.post("/cms/article/save",data)
}
/**
 * 修改文章
 * @param {{}} data 
 * @returns 
 */
 export const update = (data) =>{
  return axios.post("/cms/article/update",data)
}
/**
 * 删除文章
 * @param {{}} ids
 * @returns 
 */
 export const remove = (ids) =>{
  return axios.post("/cms/article/remove",{
    ids: ids
  })
}